﻿;_____________________________________________________________________
;---------------------------------------------------------------------
;	File: PML_GUI_build
;---------------------------------------------------------------------
;	Group: Overview
;
;	 	File containing the code for building and showing the guis
;		for the pm app launcher
;
;	Group: About
;		General script file information
;
;		- *Written By:* 	Rameen Bakhtiary
;		- *Last Modified:*	11/29/2011
;_____________________________________________________________________
;---------------------------------------------------------------------




;_________________________________________ M A I N   G U I _________________________________________
;***************************************************************************************************
PMgui_MainGui:

	; Gui  Options
	;============
	Gui, +ToolWindow +Border -Caption -Theme +AlwaysOnTop
	Gui, Color, White
	
	; Graphics/Images
	;==================
	Gui, Add, Picture, y0 x0 gtitleAction, Resource\PML_title.png
	Gui, Add, Picture, y325 x0,Resource\PML_bottom.png
	Gui, Add, Picture, x0 y0, Resource\PML_sides.png
	Gui, Add, Picture, x268 y0, Resource\PML_sides.png
	Gui, Add, Picture, x0 y120 gPMgui_appIcons,Resource\PML_buttonbg.png
	
	; Display Version (Show red If need update)
	;=================================
	If needsUpdate
		Gui, Font, S8 w500 CRed, Verdana
	If !needsUpdate
		Gui, Font, s8 w500 cdefault, veranda
	Gui, Add, Text, x10 y330 h14, Version: %version%

	; OPEN PDF Entry field/button
	;========================
	Gui, Font, s8 cdefault w1000, arial
	Gui, Add, Text, x43 y66 , OPEN PDF DWG:
	Gui, Add, Edit, x+5 y64 w75 h18 gPMF_dwgChk vsText, 
	Gui, Add, Button, x+1 y63 w25 h20 gPMF_dwgSearch +Default +Disabled, Go
	
	; EDS / EFD Buttons
	;==================
	buttonX:=22
	buttony:=95
	efdbutton_hwnd=
	edsbutton_hwnd=
	Gui, Add, Button, x%buttonX% y%buttony% w110 h26 hwndEFDbutton_hwnd gPMgui_EFDshow,EFD Checklist  >>
	Gui, Add, Button, x+5 yp w110 h26 hwndEDSbutton_hwnd gPMgui_EDSshow,Mandrel EDS  >>
	
	
	; Show Gui
	;==========
	Gui, Show,h350 w271, Permanent Monitoring Apps
Return
		
		
	


;__________________________________________  E F D   G U I _________________________________________
;***************************************************************************************************
PMgui_EFDgui:
3guiescape:
3GuiClose:
	Gui, 1:-Disabled
	Gui, 3:Destroy
	Gui, 3:-Caption +Border +ToolWindow +AlwaysOnTop
	Gui, 3:Color, White
	Gui, 3:Add, Text, x62 y17 w70 h20 , RTA Number:
	Gui, 3:Add, Edit, x132 y17 w100 h20 gPMF_buttonDisabler vefdRTAnum,
	Gui, 3:Add, Button, x16 y57 w90 h30 +Disabled gCreate_New_EFD, Create New
	Gui, 3:Add, Button, x106 y57 w90 h30 +Disabled gComplete_EFD_as_Checker, Complete Existing
	Gui, 3:Add, Button, x196 y57 w90 h30 +Disabled gView_/_Re-Print_completed_EFD, View Completed
	Gui, 3:Font, s10 w1000, arial Bold
	Gui, 3:Add, Button, x282 y1 w20 h20 g3guiclose, X
	If !firstRun
		Return
	Goto, main
Return

PMgui_EFDshow:
	Gui, +Disabled
	WinGetPos, mx, my,,,Permanent Monitoring Apps
	mx:=mx+buttonX+109
	my:=my+buttonY+1
	Gui, 3:Show, x%mx% y%my% w303 h101, EFD Checklist
Return






;__________________________________________  E D S   G U I _________________________________________
;***************************************************************************************************
PMgui_EDSgui:
4guiescape:
4GuiClose:
	Gui, 1:-Disabled
	Gui, 4:Destroy
	Gui, 4:-Caption +Border +ToolWindow +AlwaysOnTop
	Gui, 4:Color, White
	Gui, 4:Font, w600,
	WinSet, trans, 170, Mandrel EDS
	Gui, 4:Add, Text, x20 y17 h20 , Mandrel Assembly Num:
	Gui, 4:Add, Edit, x+3 y15 w100 h20 gPMF_buttonDisabler vmndAssyNum, 9293-
	Gui, 4:Add, Checkbox, x16 y+13 vthreadInfo +Checked +Hidden, Get Thread data for new EDS
	Gui, 4:Add, Button, x16 y+7 w90 h30 +Disabled gcreate_new_eds, Create New
	Gui, 4:Add, Button, x+1 yp w90 h30 +Disabled gedit_an_existing_EDS, Edit EDS
	Gui, 4:Add, Button, x+1 yp w90 h30 +Disabled gopenStdEds, Open std. version
	Gui, 4:Font, cBLUE,Default
	Gui, 4:Add, Button, x198 y+5 w90 h30 +Disabled +Center gcopyCWIpath, Load File to CWI
	Gui, 4:Font, s10 w1000 cdefault, arial
	Gui, 4:Add, Button, x282 y1 w20 h20 g4guiclose, X
	If !(firstRun){
		firstRun:=True
		Return
	}
	Goto, main
Return

PMgui_EDSshow:
	Gui, +Disabled
	WinGetPos, mx,my,,,Permanent Monitoring Apps
	mx:=mx + buttonX+224
	my:=my+buttony+1
	Gui, 4:Show, x%mx% y%my% w303 h103, Mandrel EDS
	Sleep, 100
	Send, {Right}
Return














